# CUDA11.4
FROM ts:v3 as builder

COPY . /data/code
COPY Arial.ttf /root/.config/Ultralytis/

FROM nv_cu_114_base:v1

RUN rm -rf /usr/local/bin/python3 && rm -rf /usr/bin/python3

COPY --from=builder /data/code /data/code
COPY --from=builder /usr/bin/python3.9.10 /usr/bin/python3.9.10

RUN export PATH=/usr/bin/python3.9.10/bin:$PATH && rm -rf /usr/bin/python \
    && ln -s  /usr/bin/python3.9.10/bin/python3 /usr/bin/python && ln -s /usr/bin/pip3 pip

ENV PATH /usr/bin/python3.9.10/lib/python3.9/site-packages/:$PATH
ENV PATH /usr/bin/python3.9.10/bin/:$PATH

WORKDIR /data/code

EXPOSE 8637

ENTRYPOINT ["sh","server.sh"]
